/**
 * 
 */
package com.hp.bon.sgw.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Transient;

@Entity
@Table(name = "BLACKLIST_RESULT_T")
@SequenceGenerator(name = "sequenceGenerator", sequenceName = "BLACKLIST_RESULT_T_SEQ")
public class BlackListResult {
	private Long id;
	private String hostId;
	private String serviceContextId;
	private String userIp;
	private String keyXmlTag;
	private String rcXmlTag;
	private Long blackTime;
	private String blackState;
	private Date stateDate;
	
	@Id
	@Column(name="ID")
	@GeneratedValue(strategy = GenerationType.AUTO, generator="sequenceGenerator")
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	
	@Column(name="HOST_ID")
	public String getHostId() {
		return hostId;
	}
	public void setHostId(String hostId) {
		this.hostId = hostId;
	}
	
	@Column(name="SERVICE_CONTEXT_ID")
	public String getServiceContextId() {
		return serviceContextId;
	}
	public void setServiceContextId(String serviceContextId) {
		this.serviceContextId = serviceContextId;
	}
	
	@Column(name="KEY_XML_TAG")
	public String getKeyXmlTag() {
		return keyXmlTag;
	}
	public void setKeyXmlTag(String keyXmlTag) {
		this.keyXmlTag = keyXmlTag;
	}
	
	@Column(name="USER_IP")
	public String getUserIp() {
		return userIp;
	}
	public void setUserIp(String userIp) {
		this.userIp = userIp;
	}
	
	@Column(name="RC_XML_TAG")
	public String getRcXmlTag() {
		return rcXmlTag;
	}
	public void setRcXmlTag(String rcXmlTag) {
		this.rcXmlTag = rcXmlTag;
	}
	
	@Column(name="BLACK_TIME")
	public Long getBlackTime() {
		return blackTime;
	}
	public void setBlackTime(Long blackTime) {
		this.blackTime = blackTime;
	}
	
	@Column(name="BLACK_STATE")
	public String getBlackState() {
		return blackState;
	}
	public void setBlackState(String blackState) {
		this.blackState = blackState;
	}
	@Column(name="STATE_DATE")
	public Date getStateDate() {
		return stateDate;
	}
	public void setStateDate(Date stateDate) {
		this.stateDate = stateDate;
	}
	
	@Transient
	public String getKey(){
		return String.format("<%s><%s>[%s][%s]", this.hostId, this.serviceContextId, this.keyXmlTag, this.rcXmlTag);
	}
}
